from hep.aida import IDataPointSet
from jscinttools.utilities.aidautilities import AidaFileReader
from java.lang import String
from java.lang import System


afrL = AidaFileReader("/home/marc-antoine/Documents/BGO/QFin/ScintillationAnalysis_BGO")
afrQ = AidaFileReader("/home/marc-antoine/Documents/BGO/QFin/QueensData/queenstools/ScintillationAnalysis_BGO_QFile")

mainLDPS = afrL.grabDPS("/Light_Yield/LY_RelInt_Comp#1")
agLDPS = afrL.grabDPS("/Light_Yield/LY_RelInt_Comp#2")
mainQDPS = afrQ.grabDPS("/Light_Yield/LY_Q_RelInt_Comp#2")
agQDPS = afrQ.grabDPS("/Light_Yield/LY_Q_RelInt_Comp#3")

print("\n=================================\n\tBGO-L Main Component\n=================================")
for i in range(mainLDPS.size()):
	print("T = " + String.valueOf(mainLDPS.point(i).coordinate(0).value()) + " K \t LY = " + String.valueOf(mainLDPS.point(i).coordinate(1).value()) + " +- " + String.valueOf(mainLDPS.point(i).coordinate(1).errorMinus()) + " %")
	
print("\n=================================\n\tBGO-L AG Component\n=================================")
for i in range(agLDPS.size()):
	print("T = " + String.valueOf(agLDPS.point(i).coordinate(0).value()) + " K \t LY = " + String.valueOf(agLDPS.point(i).coordinate(1).value()) + " +- " + String.valueOf(agLDPS.point(i).coordinate(1).errorMinus()) + " %")
	
print("\n=================================\n\tBGO-Q Main Component\n=================================")
for i in range(mainQDPS.size()):
	print("T = " + String.valueOf(mainQDPS.point(i).coordinate(0).value()) + " K \t LY = " + String.valueOf(mainQDPS.point(i).coordinate(1).value()) + " +- " + String.valueOf(mainQDPS.point(i).coordinate(1).errorMinus()) + " %")
	
print("\n=================================\n\tBGO-Q AG Component\n=================================")
for i in range(agQDPS.size()):
	print("T = " + String.valueOf(agQDPS.point(i).coordinate(0).value()) + " K \t LY = " + String.valueOf(agQDPS.point(i).coordinate(1).value()) + " +- " + String.valueOf(agQDPS.point(i).coordinate(1).errorMinus()) + " %")
